package com.ykq.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ykq.dao.RoleDao;
import com.ykq.entity.Role;
import com.ykq.service.RoleService;
import com.ykq.util.CommonResult;
import com.ykq.util.TableLayUi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: qy145-key
 * @description:
 * @author: 闫克起2
 * @create: 2021-12-17 08:53
 **/
@Service("roleService")
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleDao roleDao;
    public TableLayUi findRoleByPage(int page, int limit) {
        PageHelper.startPage(page,limit);
        List<Role> roles= roleDao.findAll();
        PageInfo<Role> pageInfo=new PageInfo<Role>(roles);
        return new TableLayUi(0,"",pageInfo.getTotal(),pageInfo.getList());
    }
}



















